package com.ruoyi.volunteermajor.mapper;

import com.ruoyi.volunteermajor.domain.ExamVolunteerMajor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ExamVolunteerMajorMapper {

    @Select("SELECT * FROM tb_volunteer_major WHERE id = #{id}")
    ExamVolunteerMajor selectVolunteerMajorById(Long id);

    @Select("SELECT * FROM tb_volunteer_major WHERE college_id = #{collegeId}")
    List<ExamVolunteerMajor> selectVolunteerMajorListByCollegeId(Long collegeId);

    @Insert("INSERT INTO tb_volunteer_major (college_id, name) VALUES (#{collegeId}, #{name})")
    int insertVolunteerMajor(ExamVolunteerMajor volunteerMajor);

    @Update("UPDATE tb_volunteer_major SET college_id = #{collegeId}, name = #{name} WHERE id = #{id}")
    int updateVolunteerMajor(ExamVolunteerMajor volunteerMajor);

    @Delete("DELETE FROM tb_volunteer_major WHERE id = #{id}")
    int deleteVolunteerMajorById(Long id);
}
